package com.example.demo.dao;

import com.example.demo.entity.Employee;
import org.apache.catalina.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.persistence.Column;
import java.util.List;

public interface EmployeeDao extends CrudRepository<Employee,Integer>,JpaSpecificationExecutor<Employee>, JpaRepository<Employee,Integer> {
    public List<Employee> findAllBy();

    public Employee findAllByName(String name);

    @Query(value = "select * from employee ",nativeQuery = true)
    public Page<Employee> employeePage(Pageable pageable) ;
}
